package org.nw.vo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.codehaus.jackson.map.annotate.JsonSerialize;

/**
 * remoteCombox的dataUrl返回的VO
 * 
 * @author xuqc
 * @date 2013-12-11 上午10:43:50
 */
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class ComboxJsonVO {

	public static final String TEXT = "text";
	public static final String VALUE = "value";
	public static final String RECORDS = "records";

	List<Map<String, Object>> records = new ArrayList<Map<String, Object>>();

	/**
	 * 增加一个选项
	 * 
	 * @param displayName
	 * @param value
	 * @author xuqc
	 * @date 2013-12-11
	 * 
	 */
	public void addOption(String displayName, Object value) {
		Map<String, Object> option = new HashMap<String, Object>();// 一个选项
		option.put(TEXT, displayName);
		option.put(VALUE, value);
		records.add(option);
	}

	public List<Map<String, Object>> getRecords() {
		return records;
	}

	public void setRecords(List<Map<String, Object>> records) {
		this.records = records;
	}

}
